<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 短路运算的应用

        function star(num) {
            return "*".repeat(num || 5);
        }

        console.log(star(1));

        let a = 6, b = 0;

        let f = a || b;

        // console.log(f);

        // let sex = prompt("请输入性别") || "保密";

        // console.log(sex);

        if (a || b) {
            console.log("baidu.com");
        }

        console.log(b == a);
        if (a) {
            console.log(b)
        }
    </script>
</body>

</html>